/** @file   config.h
    @author M. P. Hayes, UCECE
    @date   15 May 2007
    @brief  Config definitions.
*/
#ifndef CONFIG_H
#define CONFIG_H

/* Data typedefs.  */
#include <stdint.h>

typedef uint8_t bool;

#define TRUE 1
#define FALSE 0

#include "target.h"

#ifdef __AVR__
#include <util/delay.h>
#include <avr/io.h>
#include <avr/sleep.h>
#include <avr/interrupt.h>
#define HOSTED 0
#else
#include "avrsim.h"
#define HOSTED 1
#endif

#ifndef _BV
#define _BV(X) (1 << (X))
#endif

#define BIT(X) _BV(X)

/* Macros to set, clear, and test bits.  */
#define BSET(PORT, PIN)  ((PORT) |= (BIT (PIN)))
#define BCLR(PORT, PIN)  ((PORT) &= ~(BIT (PIN)))
#define BTST(PORT, PIN)  ((PORT) & (BIT (PIN)))

#define ARRAY_SIZE(ARRAY) (sizeof(ARRAY) / sizeof (ARRAY[0]))


#endif

